<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style media="screen">
    .flex-container {
      display: flex;
      height: 300px;
      border: 1px solid #ddd;
    }


    .flex-item {
      width: 40%;
      /*flex: auto;*/
      flex: 1;
    }
    .flex-item:nth-child(even) {
      background-color: gray;
    }

    .flex-item:nth-child(odd) {
      background-color: blue;
    }
  </style>
</head>
<body>
  <div class="flex-container">
    <div class="flex-item">1</div>
    <div class="flex-item">2</div>
    <div class="flex-item">3</div>
  </div>
</body>
</html>
